package only.my.railgunys.weapon;

import only.my.railgunys.bean.Character;
import only.my.railgunys.bean.Weapon;

public class EngulfingLightning extends Weapon {
    public EngulfingLightning(int refineLevel){
        this.atk = 608D;
        this.subStatValue = 55.1;
        this.refineLevel = refineLevel;
        this.name = "薙草";
        this.code = 4;
    }

    @Override
    public Character subStatEnhance(Character character) {
        character.addRecharge(subStatValue);
        double rechargeAfterBurst =30 + 5 * (refineLevel - 1);
        character.addRecharge(rechargeAfterBurst);
        return character;
    }

    @Override
    public Character specialAbility(Character character) {
        Double recharge = character.getRecharge();
        double refine = 1 + (refineLevel - 1) * 0.25;
        character.setAtk_ex(character.getAtk_ex()+0.28*refine *(recharge -100));
        double percentATK = (recharge - 100) * 0.28 * refine;
        int max = 80 + 10 * (refineLevel - 1);
        character.addAtk(Math.min(percentATK,max));
        return character;
    }
}
